home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / O Boy / Source / OBoy_hi.h < prev    next >
C/C++ Source or Header  |  1997-09-24  |  2KB  |  109 lines

  1. #pragma once on
  2. /*
  3.     OBoyHI.h
  4.     © Bob Boylan 1996
  5.  
  6.     Revision History
  7.     MacHack 1996        Initial creation
  8. */
  9.  
  10. #include "AEObj_pd.h"
  11. #include "PropertyValue_pd.h"
  12.  
  13.  
  14. //    -----------------------------------------------------------------
  15. //    the human interface of OBoy
  16. //
  17. class OBoy_hi
  18. {
  19. public:
  20.     // ctor
  21.             OBoy_hi();
  22.     // dtor
  23.         virtual    ~OBoy_hi();
  24.  
  25.     // output
  26.         void        ReDraw();
  27.         void        NewSubModel( Clone_ut< AEObj_pd > inAEobj );
  28.         void        NewPropertyValue( Clone_ut< PropertyValue_pd > inPropertyValue );
  29.         static
  30.         void        ShowAbout();
  31.         void        AdjustToSize( Rect theOldRect, Rect theNewRect );
  32.  
  33.     // input
  34.         void         HandleClick(EventRecord * theEvent);
  35.         void        HandleKeyDownEvent(EventRecord & theEvent);
  36.  
  37.     // access
  38.         inline
  39.         ListHandle    GetListH() { return _ListH; }
  40.         inline
  41.         WindowPtr    GetWindowP() { return _WindowP; }
  42.         
  43.     // statics 
  44.         static Boolean        _CancelWasIssued;
  45.         static RGBColor        _BackGroundGray;
  46.  
  47.  
  48.  
  49. protected:
  50.     // class local enums
  51.         enum EHButton
  52.         {
  53.             AllButtons        = 0xFFFF,
  54.             UpHButton        = 0x0001,
  55.             DownHButton        = 0x0002,
  56.             LeftHButton        = 0x0004,
  57.             RightHButton    = 0x0008,
  58.             NoHButton        = 0x0010
  59.             
  60.         };
  61.     
  62.     // more input
  63.         // TrackButtonHit - for the 'a' and 'b' button
  64.         Boolean        TrackButtonHit( Int_16 inButtonItem );
  65.         virtual
  66.         void        HandleNavButton(EventRecord * inEventP, Point inLocalWhere);
  67.  
  68.     // more output
  69.         // performing an update of the object data
  70.         void    UpdateObjectData();
  71.         void    UpdateName();
  72.         void    UpdateProgress();
  73.         void    DrawO( Int_32 inStage );
  74.         void    DrawHierNavButton( EHButton inButtonToDraw = AllButtons, Boolean inHighlight = false );
  75.  
  76.  
  77.  
  78.     // FindHButton ... within the nav button we need to know the direction
  79.         EHButton    FindHButton( Point inLocation );
  80.  
  81.     // the function that handles the navigation of the hierarchy   
  82.         void    NavigateHier( EHButton inDirection, EventRecord * inEventP );
  83.  
  84.     // function to handle updates of size
  85.         void    UpdateNavRegions();
  86.  
  87.  
  88. private:
  89.  
  90.     // data, lots of it
  91.         WindowPtr            _WindowP;
  92.         ListHandle            _ListH;
  93.     
  94.         RgnHandle            _UpNavButton;
  95.         RgnHandle            _DownNavButton;
  96.         RgnHandle            _LeftNavButton;
  97.         RgnHandle            _RightNavButton;
  98.     
  99.         Clone_ut<AEObj_pd>                            _Obj;
  100.         vector< Clone_ut<AEObj_pd> >                _SubModels;    
  101.         vector< Clone_ut<PropertyValue_pd> >        _PropertyValues;    
  102.         
  103.         Int_32                _TimeOfLastProgressUpdate;
  104.         Int_32                _Progress;
  105.         Boolean                _UpdateInProgress;
  106.     
  107.         Int_32                _MaxItemsToShow;
  108. };
  109.